package gui;

import javax.swing.JTable;

import model.NotizManagement;

public class NotizTabelle extends JTable {
	
	private NotizManagement model = new NotizManagement();
	private static final long serialVersionUID = 1L;
	
	public NotizTabelle(){
		super();
		setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
		setColumnSelectionAllowed(false);
		setCellSelectionEnabled(false);	
	}
	
	public void setModel(NotizManagement tbm){
		model = tbm;
		super.setModel(tbm);
		getColumnModel().getColumn(0).setMaxWidth(30);
	}

	public void notizHinzufuegen(String text) {
		model.notizHinzufuegen(text);
		
	}

	public void laden() {
		model.laden();
		
	}

	public void speichern() {
		model.speichern();
	}

}
